functions to swizzle instance/class methods.