improve method to get pluginMode