variable extractor code