fix ancestry for s3 resource
move file_resource into separate file