refactoring complet