moves base code into framework.js file.