Utils for code extraction and instrumentation