refactor.
fixing and refactor.