fixes to observer and template pattern