refactoring corpus classes.