Rearrange modules, add and update test codes