Changing class inheritance