final fixes
Added refactoring documentation.