add support for spying methods.