some refactor...