transaction to DB, some tree refactor, DB fix.