Refactoring Anagram.