Refactoring and Setting up login gui