Refactoring of PigLatin to make testing easier