refactored transaction balance method