if problem_type_A:
if variation_1:
do ...
elif variation_2:
do ...
elif problem_typeB:
...This is a very effective technique.
If you have diligently done the items above, with intellectual maturity, you are mostly done. In that case, I suggest: