Creation of getRealClass method to replace basename function