function in module pattern in js