improving code style
Refactored get_module_previews function