Move the callbacks and wrapper definitions into internal modules