Refactoring bindPopup example