update module to export as function