Extracted tmp file creation to Utils