refactored the mpodule