Extract duplicate code into super type.