Updated to support older function calls and extract_template mock