Use namedtuple instead of dictionary for I/O handlers