Update diagrams and refactoring