def filter_message(message, first=False):
    """
    Filters out uneccessary text from console output
    """
    lines = message.split('\n')[(1 if first else 5):]
    if not first:
        lines[0] = lines[0][1:]

    stop = 0
    while stop < len(lines):
        if lines[stop] == '>Saved.':
            break
        stop += 1

    if stop < len(lines):
        lines = lines[:stop]

    return '\n'.join(lines)