marker popup code cleaned up