refactor web.py client