Improved rating lookup JS