Plugin implementation

Tidying up