Move getting the curvelist for client and server out of the loop