Readability improvements

I think the use of namedtuple and format make a difference in clarity.