refactoring viewport
refactoring viewport