Finish sign in
Refactor tests
Finish sign in and refactor tests