Updated code from depreceated classes.