Separate enhanced_context function