Palindrom refactored