Improvements to callback handling