cleanups and optimizations
optimized JVM LongArray version