Refactoring namedtuples