Implementation for try_get_department