HCompiler rewrite, part 1