WIP: small refactoring (rewritten categories back to types)