errore refactor