Refactor client to interface for better testability
Add test for TypeString