Few modifications

To use the FileManager class everywhere. Delete obsolet code.