Refactor layouts and add js to task avatar edit