Improved use of nicer types in callbacks.