Refactor to fit with new method for initing plugins