Removed CTX_CAST and CTX_REFERENCED.
Embed ctx_ as a member variable (not a pointer).