Remove repetitive code.