refactored masonry resizing/reshuffling