Refactored to make the views significantly more easily maintained.