Refactored transaction state into its own object. Each transaction creates a new transaction state object upon initialization.