improve  a few code