reorganising corpus builder with a little OOP.