refactored the corpus wrapper class