Merge "Reduce code duplication"