Updating `is_user_logged_in` and `is_maintenance` checks to avoid dependency on class objects in the shutdown phase.