refactored duplicate expectations by introducing private method