Merge pull request #148 from erickt/bug

Remove duplicate code when creating client