Cleaning up rotation code.