Use mock more intelligently.