Rework the whole layout system