Put JS into another file, and fix validation.