refactor textinput