fix typo and remove a code copy