Fixed includes to remove compile warning
Refactored plugin callbacks