Change render template logic