Refactored departments into a departmentsModel