Use if cascade instead of the dict

... because this imperative style looks actually nicer and more readable than
its data structure counter part. Also it might be a tad more efficient as we
might do less evaluations. But that's probably neglible.