sort transactions
refactor