refactoring grant_write_link_<provider> code - 5