changed functionality to use routers