refactor to move utility methods into a separate module