Refactoring mouse/touch controls