Moved shared_context to the top level.