Code refactoring.
Add one more test.
Code refactoring.