Move login method to loginActivity