some index.js code move to mirror.js