import re


def process_sentence(sentence, max_len, counter=None):
    """
    Lowercase, trim, and remove non-letter characters,
    and catalogue word counts in counter, if provided.
    Should the number of words exceed max_len, return None.
    """
    # reduce number of exclamations, etc
    sentence = re.sub(r"([.!?])", r" \1", sentence)
    # remove non-letter characters
    new_sentence = re.sub(r"[^a-zA-Z.!?]+", r" ", sentence)
    words = new_sentence.lower().strip().split(' ')
    if len(words) > max_len:
        return None
    else:
        for word in words:
            if counter is not None:
                counter[word] += 1
        return words