Refactored all tests to use stubs