Refactor the WordLadder to get shorter methods