converted to metaclass