better file generation