rewrite decode part code