Add dynamic callback handler and tests