A little refactoring
Beginnings of plugins