another bigger refactoring for better view handling related to type of library