more re-factoring and login UI works with new system