refactored rotation