Updating class name and variable of object