more refactor - added relevant functions to utils