Refactored metaclasses