Refactor to AsyncTask