Restructured state organization to move login system to a separate part of the app.