Refactoring of Core.js