split table functions out