Refactor of documentation generator