added template model and join