Remove deprecated warnings from 2 methods