Minor refactoring and add tests
Implement proxy objects in client library