Refactored to use the "Module" pattern.