refactored ability to support logged-out users