refactor to separate routes