Renamed custom array walk and remove helper function