Refactored some reverse iterator usage