improved implementation of Categorical