model bug fix
code cleaning