Refactored util functions to utils.js
Adde a more complete implementation for scraping departments