minor refactor in ami.client