Simplify some expressions because of defaultdict