Remove collect_contexts function