refactored sign-in-to-website into five patches