Refactoring of common code between file load and uses diagrams