``_input_map`` is really just a complex factory function? I think this can be simplified