refactor expected array to object