Refactoring tests into this module