Remove some repetitive code. [1303]