little refactor on input.js, no functionality modified