core.js cleanup