refactors and infowindow