refactors split phrase method