Little bit of cleanup and add distortion type param