ngc: factored out the method compiler.