trim empty lists and dicts