It doesn't have to be 'case'. Much cleaner solution, in my opinion, would be adding a function `call_fun/1` which calls given Fun, if it's a fun or does nothing otherwise.

On the other hand current code shows that there is such a possibility to add callback functions so I think we can stick with that.