added separately template editing code