remove duplication of code with helper functions - issue #149