cleaning up purge code