Reduce repeated codes