change js-main layout and add prelim template for scan