modularized the routing