Moved some utility functions to the correct scope