refactor for cached route