refactored to use new client model