This could probably just use the `write_file` method.