remove typo and redundant code