Transparent State Management Using the Decorator Pattern