Refactored 317 client