reorganise the script a bit; variablise the spc_client_url