add setup scripts and refractor client object