refactoring

add comments, rename namespace
some fix