cleanup and allowing functions to be decorated