Cleaned up some of the dynamic table code