fix bug and clean the code