remove unused code and fix typo