Optimizing collapse/expand feature in messageList