Code cleanup of generated async code