removed code duplication and all bad smells from LoginMaster class!
changed calls to LoginMaster caused by refactoring
fixed exception caused by closing login window unexpectedly.