Used an idiom to remove duplication.