Reduce code duplication.