refactoring completo, alpha 1