Added code for module pattern.