Optimize memory access patterns and init