Removed broken code from previous attempts at implementing callback capturing.