Math expression cleanup