Introduced the module pattern and exposed only necessary functions