Externalize database connection to `db.js`
Improve proccess