typo fix and code cleaning