refactoring for llvm