refactored input box