Added dynamic registration/unregistration
Added plugin cleanup