Plugin refactored