Refactored peregrine tex files.