move data-related funcs into one file