refactoring and implement login screen