Move some data-related helpers to data.js