refactored DocumentationGenerator.php