Added module pattern code