Fixing time and refactoring AuthManager.