small refactoring & documentation