import re


def filter_text(text):
    """ Filter out retweet-prefix, urls, html-codes, hashtags, handles, and extra whitespaces
    :param text: a string
    :return: cleaned text
    """
    return re.sub(
        r'(RT @\S+:)|(RT)|(https?:\S+)|(&\S+;)|(@\S+)|(#\S+)', '',
        text
    )