refactor inputSubmit