more optimizations to Array