Refactored the registerAction in InputHandler