buildCleanupCallback