Attempt js optimization 1