refactor to allow wildcard routes