implementing template