Use logging instead of printing to stdout
Code simplifications in `check_module_name'