cleanup Callback code a bit