Fixes the route declarations and removes unneeded code.