tiding up core.js