src: Replacing deprecated code with non-deprecated versions

Change-Id: Ie538acd0255350fc371e8c8b95b4fdd6ba064b8e