Refactor BathData.js