extract logic into Rotor class