add Unit-test to check format and change some code styles