Replaced ui messages with async tasks and other minor changes