started refactoring into plugins