improved cli and cli test