derive new class Term and ProductTerm