Classes, reader, graph-to-tree and optimizer