small refactoring
added docs