decomposed Client Run() function