replaced code with external function from 'helpers'