splitting out loginctrl into separate file