refractor NamedResults into a map because it will help in next assignment