metaclasses to the rescue