Refactoring camera movement code