Improve category variable names and detection