Improve input functionality