Added a function for module extraction.