you can use a decorator. see Line 358