refactoring e gestione shell