Replaced some deprecated methods by their replacements