refactor to hold transactions in memory db
refactor to hold transactions in memory db