Remove duplicate code of layout config form