Rewrite table code for wells.