refactoring of txn.h/txn.cc (WIP)
more refactoring