merge and cleanup