restructure client code so that each route uses its own files