Refactoring: extract `buildLayoutInfo` method.