refactorized palindromo.rb