Refactoring.
Refactoring.
Tests fixed.