Camera refactoring and code cleanup