improve tests with stubbing