Refined input.js