Minor refactoring, infoWindow improvement

Still a lot of ugly stuff lurking in here.