dedup proc code
add libclient.py