refactor sk_txn
add thread local env
refine the logic of processing working flow