Refactored js files and captcha scripts