more layout gen improvements