move utility functions to a new file