Refactoring captcha