InputHandler rewrite