Changed from the Apache 3.1 client to the 4.2.5 version. Refactored the client at the same time.