Rework login button handler