merge and purge