fix typo and clean up a bit