fix specs, refactor to allow immediate sign-in.