Decorator implemented using class