some refactor.