Fix typo

and some code cleaning