Refactor module and update regression testing