#52 some refactor.