huge refactoring to have importable plugins