handle mocking during expansion