Avoiding usage of deprecated methods