Use namedtuple instead of dictionary