refactoring and rotation methods