Minor improvments

- remove `connect`, as not used
- separate middleware logic in `app.js`