Cleaned up db.js