Similar Items: Optimizing tree decompositions in MSO