add module pattern (work in browser and node)