refactor helper methods out