Refactored inputHandler system.