change categories structure with adding type information