refactor camera.js.
Cleanup, refactor