split out utility functions into their own module