Refactoring the management of layout items