improve - refactor transaction api