refactor a mitad