Refactor make_input