Refactored use of SP client.