minor changes
largely begin to rewrite client lib