Moved camera code to camera.js