Refactor module tests