Refactored edit rollback code into a master route.