Refactor ror into a separate module