Continue refactor of plugin