refactored Input.