refactor to remove smelly helper method