Refactoring TP2 completo