Refactor extract write_file
Make ui task add ui route