Improve sign in form and decouple tests from implementation.