Applied smart pointers to File and relevant classes and Removed some deprecated or redundant methods