Miguel/plugin refactor

Let me just provide more feedback in 87...