small refactor in buildingGen