add tests for extract and refine functions, complete all tests as passed