replace deprecated functions and views