flow layout optimizations