Improve code and add more test. Reach 90percent coverage.