Refactorized some stuff and fixed openPopup when clicking on tweet name on the legend