fix small errors on refactoring