all core code in shell.js