Fix code duplication reported by scrutinizer.
Improve generic views.