refactoring of gird layout doesn't work