move login function to another controller