refactor out basic field generation in gen-hs