Improving from bad to code to tolerable one