Moved utilities out of main file