suggest reducing this block to a ``dict`` lookup where the keys are ``["str", str, "int", int, ...]`` and the values are ``[lambda x: foo, lambda x: bar, ...]``, then you only need a single return