Make it work for class methods