updated to support dynamic output directory and customizing the module name