refactoring, fixing documentation