refactored corpus classes and trait