Login server refactor