Flatten the callback structure
Add script wrapper and callback injection