refactor to use helper method