before refactoring
refactor view handling a bit