restructured code for sign-in buttons