Refactoring, began separating library from plugin