Optimization on arrays and remove slow methods.