DRYed up the callback-wrapping.