rewrite module and test case