Decorator for terrible function