refactored to revealing module pattern