fix some refactor errors