Avoid usage of deprecated API