Refactor createFileEntry