refactor pluginmessengerlistener