UPD: global refactoring: add comments, some bugs are fixed
BUILD: rebuild project
FIX: a lot of refactoring errors are fixed