Make the router generic for testing