Renamed and begun blending duplicate code.