refactor double metaphone: move code to methods