refactor transaction service