Refactor plugins