implemented element template pattern