changing global mocks to local mocks