refactor rotation