refactor to do less