Edge rerouting refactored