Miguel/plugin refactor

done