Move client instantiation in specs to a let
Move JSON parsing to an auxiliary method