Updated the view to handle any element type