make some improvement for unit test