abstracted most of scene.js to library.js