Decorator replaced with if condition