refactoring with plugin base