Use native Array functions instead of each loops