Refactored plugin structure