[#refactor] - eliminated most of the code duplication in LPClient.php