Removed redundant code from display_element