small code refactor in test mocks