refactor plugins