Moved exec function from index.js to core.js