collect all TMS calls into 2 functions