refactoring view slightly