refactored displayTweet function