replaced dict with namedtuple