refactors split_phrase method