Refactor data.js
SUpport time difference as visible parameter