Refactor HVMT translate methods into a CodeWriter class, as suggested byt he text