Sumada Kaabaha: optimize javascript