Moved blocking operations into threads soas to not block the UI