rearrange login controller