reorganize login stuff