[FrontEnd] Refactored login screen code