execute js when in browser, and refactor style
merge