extract shell for QA from ca-client-shell, better logging, further optimization