def make_lists(to, cc, bcc):
    """Cleanup to, cc and bcc (removes duplicates)."""

    to = set(to or [])
    cc = set(cc or [])
    bcc = set(bcc or [])

    to -= cc | bcc
    cc -= to | bcc
    bcc -= to | cc

    return list(to), list(cc), list(bcc)