restore form on sign in page
refacotr model into smaller, and fix tests