add more tests.
refactor.