improve with template