Finish sign in
Refactor test code