Move login method from controller to service