def _minimize(obj):
    """Remove lists with only one entry"""
    if isinstance(obj, list):
        if len(obj) == 1:
            return _minimize(obj[0])
        else:
            result = []
            for x in obj:
                y = _minimize(x)
                if y:
                    result.append(y)
            return result
    else:
        return obj