moved plugin and extends related code into the plugin factory