More refactoring, and fixing login page CSS