Refactoring in rotation.rb.