Eliminate some repetitive code.