make parsing module name into a function