Refactor all datasrc functions to be table aware