Make code depend on user department, minor tweaks