optimize JS for ListingDetails