further code cleanup in views