move helper methods into class