Code refactoring

It closes #3 issue.