import re


def charges_clean_up(charges):
    """ Returns cleaned charges. Charges are typically separated by newlines
    and can often be in all caps, which we want to avoid."""

    charges = charges.split("\n")
    charges = [charge.capitalize() for charge in charges]
    charges = "; ".join(charges)
    # we want some acronyms to be in caps for readability
    charges = re.sub("(?i)dui", "DUI", charges)
    return charges