Replaced obsolete interface with recommended one on the example code.