client: more refactoring of great big subs into

tidy little ones