refactored plugin definition