replaced namedtuples with standard classes