Refactor arrays.delete()