Replaced deprecated and outdated code.