move part of method codegenerator to typebuilder rightly