docu and refactoring