Streamlined asArray method and used array mapping to iterate when creating objects.