Reorganisation database.js