Exercise in understanding the Template Method design pattern