Refactoring.
Stable version.