Fix Callback pattern and add function object management