In this chapter, we describe a more refined representation for expressions, via class hierarchies. This representation offers a more natural syntax for creating expressions and a better encapsulation of functionality, and it will also be instrumental as a stepping stone towards our simple re-implementation of the PyTorch learning framework.