C++-code is functionally equivalent to the old, but has been verbosed
with a few classes