Source pattern matching --> extract function