Add unit test and remove dirty code.
For checking why all tests in jenkins pass.