refactoring reverse method