This bit of common logic would work well as a decorator.