Refactor transactions table