Refactored.
Refined tests.