Refactoring - second try

@domoritz @marekkalnik The error looks like it is right here. The setLatLng function is not being passed the latlng variable.