refactored Plugin to be a class object for type detection