Generic Function for element