Refactored code for module installation.
Fixed typo