move the init func to common.js