move data processing to a separate file, publish.js