modified addThisCode to manage the modules, added PreviewModuleClass