refact with option to config.js and create messages.js && sessions.js for global features