restructure unit test.