separating classes, adding to Plugin interface.

Not done yet.