Updating JS with module pattern