Is it more efficient to create a generic method that loops through the objects elements rather than a method for each class?