More clever layout generation.