Refactoring, many fixes
Merge pull request #5 from vhordejcuk/master

Refactoring, many fixes