Simplified 'process_line' by including 'resolve_context'