refactoring codigo pepe