Refactor with helper method

@oliverbarnes here is the refactor