improved efficiency of general case of fix