Refactoring. Added work with captcha in interactive mode