Refactor and add more async stuff, remove accidentially commited write test.