refactored to generic views