Attempt JS optimization 3