purge surplus code