Improve input functions