Word Ladder - minor refactoring