start writing documentation, small refactorings