factor out compiler-driving code