simplify adding sort_elements to view context