reduce file creating memory usage