Refactoring to make currentUser() safe for use outside request handling
thread