add CompileWithTemplate