refactoring
implements simple login