Refactor helper methods