Minor refactoring.
An article for habrhabr