simplifying route change handler