structuring code + updating login view