refactoring term classes