clean up codebase by removing legacy code
add more unit tests for route facility and fix bugs for them