Replace deprecated functions