File optimizing

Started the optimizing process. Starting with files.