Refactoring Captcha checking

and solve issue #435