textinput code cleanup