Cleans up formatting inside expander and matchPatterns.