Don't use deprecated methods.

Signed-off-by: Mariusz Fik <fisiu82@gmail.com>