Moved fileExists() function to helpers.