Avoid using deprecated functions