Replace lambda with itemgetter