format the code; add worker client retry logic