Significant code simplifications to signin