Simplify transaction table logic and fix indent