refactor main.js

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
regen for d2431f5