client and clean up