few changes to order views and cleanup average method