Refactoring for new base plugin