refactoring and camera added