added a refactored version of CameraFragment