wip of small refactorings and documentation adding