It is very difficult to write perfect code because the standards upon which our code is judged is evolving every day. The beautiful as it may be now, is probably going to be ridiculed later.
Have you ever look back at some of your old code and grimaced in pain? If yes, do you have any idea how to overcome this?