Remove usage of deprecated api