Rewriting some of the input handling systems.