Apply test refactoring suggested by Nimisha.