Converted the decorator into a class based one, so it can be inherited and overridden later