artial refactoring to include communication with the instantiated plugin added close method using this technique