Full refactoring.
Merge pull request #1 from denysdovhan/pull-request

Full refactoring.