Moved decorator to a class rather than a factory function.