Creating a method function decorator