Refactor the main module test