made client parsing more general