Minor refactoring of InputManager