Move callback handling to separate module
Simplify callback method