Make login template more efficient