Minor code simplification.
Remove code duplication.