refactored captcha_library