Refactoring: Move writeToFile from Log to Utils