more extensive simplification algorithm of layout