Basic Javascript optimizations
More optimizations