added createSpy method