Cleanup - moved functions in util from core