refactoring view framework to support generics