Refactory transaction tests