refractoring get_quotes_from_words