restructure safety plugin interface