Clean up plugins
Attach events for resource plugin