Updated code for dynamic importation of classes