Implement patch functions and class decorators