better category parsing