Rework of camera code