fix(captcha): split captcha generation into multiple functions