Cleanup function and promise arguments