Refactors layout blocks.