Minor cleanup and refactor to LoginState