Refactored code, added username and password text field