Refactor hll code a bit