Updated avoiding deprecacted methods