map-popup additions, code cleanup