switched to renderJs.mapUrl, cleaned up code