split out corpus

and refactor out the instance variables