Refactor Foursquare client library