Moved callbacks to their own definition
Fixed async callbacks, work on github needed