Refactoring. Optimize test.