Refactor Captcha checking

Solve issue #435