refactoring camera