Attempt at speeing up generation by not calling setTypeId as much