Use abstraction instead of brute-forcing the grid rotation
remove useless keypresses