refact unit test