Some camera related refactoring