slight refactor of initModule. made functionality more granular.