Updated to new Plugin API