Refactored to use php client lib