Refactor emitter callback.

Try ducktype to avoid `OBJECT_TOSTRING`