Move implementation to another file and add an test case(not passed yet).