Refactored to use AsyncTask, slightly cleaner interface