small errors refactoring