Refactoring the way that we send data to SetDate.js