Add support for legacy registerCallback