first pass at the OO based approach for the context tree