Refactor id in client

Commits tell the story.

cc/ @jcrugzz