remove unnecessary defaultdicts