Refactoring of rotation