refactor metaphone