JS module pattern implemented