refactoring to pluginize