Improved Transaction with optional type attribute